#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;

const int N = 100010;
int n;
int a[N];
bool st[N];
priority_queue <int, vector<int>, greater<int>> heap;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    cin >> n;
    for(int i = 0; i < n; i++){
        int c;
        cin >> c;
        a[c] ++;
        if(a[c] == 1){
            heap.push(c);
        }
    }

    int res = n;
    while(heap.size() > 1){
        int x = heap.top(); heap.pop(); a[x] --;
        int y = heap.top();
        if(a[x] > 0) heap.push(x);
        if(!st[y]){
            res --;
            if(a[y] <= 1)st[y] = true;
            else a[y] --;
        }
    }

    cout << res << endl;
    return 0;
}
